#ifndef H_I_PROTOCOL_ACCEPTOR_IMPL_H
#define H_I_PROTOCOL_ACCEPTOR_IMPL_H

#include "../typedefine.h"
#include <memory>
#include "../promise.h"
#include "EProtocolErrorCode.h"

namespace QWER
{
	QINTERFACE IProtocolSocketImpl;

    QDLL_EXPORT QSTRUCT SProtocolAcceptRet
    {
    public:
        SProtocolAcceptRet(EProtocolErrorCode eErrorCode): m_eErrorCode(eErrorCode) {
        }
        SProtocolAcceptRet(EProtocolErrorCode eErrorCode, std::unique_ptr<std::vector<std::unique_ptr<IProtocolSocketImpl>>>&& poNetLinkers): m_eErrorCode(eErrorCode) {
            m_poNetLinkers = std::move(poNetLinkers);
        }
    public:
        EProtocolErrorCode m_eErrorCode = EProtocolErrorCode::SocketError;
        std::unique_ptr<std::vector<std::unique_ptr<IProtocolSocketImpl>>> m_poNetLinkers;
    };

	QDLL_EXPORT QINTERFACE IProtocolAcceptorImpl
	{
	public:
#ifndef _USING_CLI
		virtual ~IProtocolAcceptorImpl(){}
#endif
        virtual CPromise<SProtocolAcceptRet>& Accept(std::unique_ptr<std::vector<std::unique_ptr<IProtocolSocketImpl>>>&& poOut) = 0;
	};
}

#endif
